home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / progjrn / pj_6_6.arc / LISTING.6 < prev    next >
Text File  |  1988-08-30  |  2KB  |  47 lines

  1.  
  2.  
  3. ---- Running the named pipe program in Unix -----
  4.  
  5.  
  6. % mknod FrankPIPE p         # This makes the named pipe in Unix
  7.                             # I'm just using the arbitrary filename 'FrankPIPE'
  8.  
  9. % ls -l                     # Note the 'p' for (named) pipe for FrankPIPE
  10. total 92
  11. prw-rw-rw-   1 frank    1000           0 Aug 27 14:39 FrankPIPE
  12. -rwxrwxrwx   1 frank    1000       16836 Aug 27 14:34 client*
  13. -rw-rw-rw-   1 frank    1000         912 Aug 27 14:34 client.c
  14. -rwxrwxrwx   1 frank    1000       15828 Aug 27 14:36 daemon*
  15. -rw-rw-rw-   1 frank    1000         549 Aug 27 14:36 daemon.c
  16. -rw-rw-rw-   1 frank    1000         110 Aug 27 14:24 local.h
  17.  
  18. % daemon > logfile &
  19. 284    <-------------------- The shell prints the pid of the daemon process
  20.  
  21. % client & client & client &
  22. 285 <-------------------- The shell prints pids of the 3 client processes
  23. 286
  24. 287
  25.  
  26. % sleep 10; cat logfile
  27. PID: 286 - string: [Message from a Client]
  28. PID: 285 - string: [Message from a Client]
  29. PID: 287 - string: [Message from a Client]
  30. PID: 286 - string: [Message from a Client]
  31. PID: 287 - string: [Message from a Client]
  32. PID: 286 - string: [Message from a Client]
  33. PID: 286 - string: [Message from a Client]
  34. PID: 287 - string: [Message from a Client]
  35. PID: 285 - string: [Message from a Client]
  36. PID: 286 - string: [Message from a Client]
  37. PID: 285 - string: [Message from a Client]
  38. PID: 285 - string: [Message from a Client]
  39. PID: 286 - string: [Message from a Client]
  40. PID: 286 - string: [Message from a Client]
  41. PID: 286 - string: [Message from a Client]
  42. PID: 285 - string: [Message from a Client]
  43. PID: 287 - string: [Message from a Client]
  44. PID: 287 - string: [Message from a Client]
  45. PID: 286 - string: [Message from a Client]
  46. Byebye from Daemon        <------- I sent a SIGINT signal to a client
  47.